@import '~ng-table/bundles/ng-table.min.css';
@import '~select2/dist/css/select2.min.css';

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f9fa;
  line-height: 1.6;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.navbar-brand {
  font-weight: bold;
  color: #007bff !important;
  font-size: 1.5rem;
}

.main-content {
  flex: 1;
  padding: 20px 0;
}

.card {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: none;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid #eee;
  font-weight: 600;
  border-radius: 12px 12px 0 0 !important;
}

.navbar {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-link {
  transition: all 0.3s ease;
  margin: 0 0.25rem;
}

.nav-link.active {
  background-color: rgba(255,255,255,0.2);
  border-radius: 6px;
}

.nav-link:hover {
  background-color: rgba(255,255,255,0.1);
  border-radius: 6px;
}

.btn {
  border-radius: 8px;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: translateY(-1px);
}

.form-control {
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 0.75rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.table {
  border-radius: 8px;
  overflow: hidden;
}

.table th {
  background-color: #f8f9fa;
  font-weight: 600;
  border-top: none;
}

.badge {
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
}

.modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
  border-bottom: 1px solid #eee;
  border-radius: 12px 12px 0 0;
}

.modal-footer {
  border-top: 1px solid #eee;
  border-radius: 0 0 12px 12px;
}

.list-group-item {
  border: none;
  border-radius: 8px !important;
  margin-bottom: 0.25rem;
  transition: all 0.3s ease;
}

.list-group-item:hover {
  background-color: #f8f9fa;
}

.list-group-item.active {
  background-color: #007bff;
  border-color: #007bff;
}

.text-decoration-line-through {
  text-decoration: line-through;
}

.me-2 {
  margin-right: 0.5rem;
}

/* 登录页面样式 */
.login-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-wrapper {
  width: 100%;
  max-width: 450px;
}

.login-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  overflow: hidden;
  margin-bottom: 2rem;
}

.login-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2.5rem 2rem 2rem;
  text-align: center;
}

.login-header .logo {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.login-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  opacity: 0.9;
  margin-bottom: 0;
}

.login-body {
  padding: 2rem;
}

.input-group-text {
  background-color: #f8f9fa;
  border-right: none;
  color: #6c757d;
}

.login-card .form-control {
  border-left: none;
  padding-left: 0.5rem;
}

.login-card .form-control:focus {
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
  border-color: #667eea;
}

.login-btn {
  height: 48px;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 8px;
}

.login-btn:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
  transform: translateY(-1px);
}

.login-actions {
  text-align: center;
  margin-top: 1.5rem;
}

.demo-accounts {
  background: #f8f9fa;
  padding: 1.5rem;
  border-top: 1px solid #e9ecef;
}

.demo-title {
  color: #6c757d;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.demo-account {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e9ecef;
}

.demo-account:last-child {
  border-bottom: none;
}

.account-info {
  flex: 1;
}

.account-info strong {
  display: block;
  color: #495057;
}

.account-role {
  font-size: 0.8rem;
  color: #6c757d;
}

.login-footer {
  text-align: center;
  color: rgba(255,255,255,0.8);
  font-size: 0.875rem;
}

.dropdown-menu {
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 8px;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
}

.me-auto {
  margin-right: auto;
}

@media (max-width: 768px) {
  .main-content {
    padding: 15px 0;
  }
  
  .navbar-brand {
    font-size: 1.25rem;
  }
  
  .card {
    margin-bottom: 1rem;
  }

  .login-container {
    padding: 10px;
  }

  .login-header {
    padding: 2rem 1.5rem 1.5rem;
  }

  .login-title {
    font-size: 1.5rem;
  }

  .login-body {
    padding: 1.5rem;
  }

  .demo-accounts {
    padding: 1rem;
  }
}

/* ng-table custom styles */
.ng-table {
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-radius: 8px;
  overflow: hidden;
}

.ng-table th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  color: #495057;
  padding: 12px 15px;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
}

.ng-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #f1f3f4;
  vertical-align: middle;
}

.ng-table tr:hover td {
  background-color: #f8f9fa;
}

.ng-table .sortable {
  cursor: pointer;
  transition: all 0.2s ease;
}

.ng-table .sortable:hover {
  background-color: #e9ecef;
}

.ng-table .sort-indicator {
  margin-left: 8px;
  opacity: 0.6;
}

.ng-table .text-muted {
  color: #6c757d !important;
}

.ng-table-pager {
  margin-top: 20px;
  padding: 15px 0;
}

.ng-table-pager .pagination {
  margin: 0;
  justify-content: center;
}

.ng-table-pager .pagination .page-link {
  border-radius: 6px;
  margin: 0 2px;
  border: 1px solid #dee2e6;
  color: #495057;
}

.ng-table-pager .pagination .page-item.active .page-link {
  background-color: #007bff;
  border-color: #007bff;
}

.ng-table-counts {
  text-align: center;
  color: #6c757d;
  font-size: 0.875rem;
  margin-top: 10px;
}

/* Select2 custom styles */
.select2-container {
  width: 100% !important;
}

.select2-container--bootstrap4 .select2-selection {
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.select2-container--bootstrap4 .select2-selection--single {
  height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 0.75rem;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
  color: #495057;
  padding-left: 0;
  padding-right: 20px;
  line-height: 1.5;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
  height: calc(1.5em + 0.75rem);
  position: absolute;
  top: 1px;
  right: 1px;
  width: 20px;
}

.select2-container--bootstrap4.select2-container--open .select2-selection {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.select2-container--bootstrap4.select2-container--focus .select2-selection {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.select2-dropdown {
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.select2-container--bootstrap4 .select2-results__option {
  padding: 0.375rem 0.75rem;
  color: #495057;
}

.select2-container--bootstrap4 .select2-results__option--highlighted {
  background-color: #007bff;
  color: #fff;
}

.select2-container--bootstrap4 .select2-results__option[aria-selected="true"] {
  background-color: #e9ecef;
  color: #495057;
}

.select2-container--bootstrap4 .select2-search--dropdown .select2-search__field {
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
}

.select2-container--bootstrap4 .select2-selection--multiple {
  min-height: calc(1.5em + 0.75rem + 2px);
  padding: 0;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
  background-color: #007bff;
  border: 1px solid #007bff;
  border-radius: 0.25rem;
  color: #fff;
  font-size: 0.875rem;
  margin: 0.25rem 0.25rem 0 0.25rem;
  padding: 0.25rem 0.5rem;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove {
  color: #fff;
  cursor: pointer;
  display: inline-block;
  font-weight: bold;
  margin-right: 0.25rem;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove:hover {
  color: #f8f9fa;
}

/* 禁用状态样式 */
.select2-container--bootstrap4.select2-container--disabled .select2-selection {
  background-color: #e9ecef;
  border-color: #ced4da;
  color: #6c757d;
  cursor: not-allowed;
}

/* 错误状态样式 */
.select2-container--bootstrap4.has-error .select2-selection {
  border-color: #dc3545;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}

.select2-container--bootstrap4.has-error.select2-container--focus .select2-selection {
  border-color: #dc3545;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f1b6ba;
}

/* Angular Strap custom styles */
/* Modal 样式调整 */
.modal .modal-dialog {
  margin-top: 50px;
}

.modal .modal-content {
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: none;
}

.modal .modal-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  border-radius: 8px 8px 0 0;
  padding: 1rem 1.5rem;
}

.modal .modal-title {
  font-weight: 600;
  color: #495057;
}

.modal .modal-body {
  padding: 1.5rem;
}

.modal .modal-footer {
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
  border-radius: 0 0 8px 8px;
  padding: 1rem 1.5rem;
}

/* Tooltip 样式 */
.tooltip {
  font-size: 0.875rem;
}

.tooltip-inner {
  background-color: #495057;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  max-width: 200px;
}

.tooltip.bs-tooltip-top .arrow::before {
  border-top-color: #495057;
}

.tooltip.bs-tooltip-bottom .arrow::before {
  border-bottom-color: #495057;
}

.tooltip.bs-tooltip-left .arrow::before {
  border-left-color: #495057;
}

.tooltip.bs-tooltip-right .arrow::before {
  border-right-color: #495057;
}

/* Popover 样式 */
.popover {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #dee2e6;
}

.popover-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  border-radius: 7px 7px 0 0;
  font-weight: 600;
  color: #495057;
}

.popover-body {
  padding: 1rem;
  color: #495057;
}

/* Dropdown 样式 */
.dropdown-menu {
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #dee2e6;
  padding: 0.5rem 0;
}

.dropdown-item {
  padding: 0.5rem 1rem;
  color: #495057;
  transition: all 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: #f8f9fa;
  color: #495057;
}

.dropdown-item.active,
.dropdown-item:active {
  background-color: #007bff;
  color: #fff;
}

.dropdown-divider {
  margin: 0.5rem 0;
  border-top: 1px solid #dee2e6;
}

/* Alert 样式 */
.alert {
  border-radius: 6px;
  border: none;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.alert-primary {
  background-color: #d1ecf1;
  color: #0c5460;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
}

/* Button 增强样式 */
.btn {
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn:focus,
.btn.focus {
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn-primary:hover {
  background-color: #0056b3;
  border-color: #004085;
}

.btn-secondary:hover {
  background-color: #545b62;
  border-color: #464a52;
}

.btn-success:hover {
  background-color: #1e7e34;
  border-color: #1c7430;
}

.btn-danger:hover {
  background-color: #bd2130;
  border-color: #b21f2d;
}

.btn-warning:hover {
  background-color: #d39e00;
  border-color: #c69500;
}

.btn-info:hover {
  background-color: #138496;
  border-color: #117a8b;
}

/* Datepicker 样式 */
.datepicker {
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #dee2e6;
}

.datepicker-dropdown {
  padding: 0.5rem;
}

.datepicker table tr td.active,
.datepicker table tr td.active:hover {
  background-color: #007bff;
  color: #fff;
}

.datepicker table tr td.today {
  background-color: #ffc107;
  color: #212529;
}

.datepicker table tr td:hover {
  background-color: #f8f9fa;
  color: #495057;
}

/* Timepicker 样式 */
.timepicker {
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #dee2e6;
}

/* Typeahead 样式 */
.typeahead.dropdown-menu {
  max-height: 200px;
  overflow-y: auto;
}

.typeahead .active {
  background-color: #007bff;
  color: #fff;
}